"""
职位数据后台管理
"""
from django.contrib import admin
from .models import Position, AIPosition


@admin.register(Position)
class PositionAdmin(admin.ModelAdmin):
    list_display = ['id', 'position_name', 'company_full_name', 'city', 'salary', 'education', 'work_year', 'imported_at']
    list_filter = ['city', 'big_category', 'education', 'company_size', 'finance_stage']
    search_fields = ['position_name', 'company_full_name', 'position_detail']
    list_per_page = 20
    ordering = ['-imported_at']


@admin.register(AIPosition)
class AIPositionAdmin(admin.ModelAdmin):
    list_display = ['id', 'position_name', 'company_name', 'location_city', 'salary', 'education', 'experience', 'imported_at']
    list_filter = ['location_city', 'education', 'company_scale']
    search_fields = ['position_name', 'company_name', 'tags']
    list_per_page = 20
    ordering = ['-imported_at']

